package net.minecraft.src;

import java.util.Random;

public class BlockNightmareOre extends Block {
	
	boolean dropOre = false;

	public BlockNightmareOre(int par1, Material material)
	{
		super(par1, Material.rock);
		this.setCreativeTab(CreativeTabs.tabBlock);
	}

	public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
	{
		ItemStack x = par5EntityPlayer.inventory.getCurrentItem();
		if (x == null)
		{
			dropOre = false;
		}
		else if (x.itemID == 278)
		{
			dropOre = true;
		}
		else
		{
			dropOre = false;
		}
	}

	/**
	 * Returns the ID of the items to drop on destruction.
	 */
	 public Block idDropped(int par1)
	 {
		 return mod_Part2.nightmareOre;
		 //return this.blockID == Block.oreCoal.blockID ? Item.coal.itemID : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.itemID : (this.blockID == Block.oreLapis.blockID ? Item.dyePowder.itemID : (this.blockID == Block.oreEmerald.blockID ? Item.emerald.itemID : (this.blockID == Block.oreNetherQuartz.blockID ? Item.netherQuartz.itemID : this.blockID))));
	 }

	 /**
	  * Returns the quantity of items to drop on block destruction.
	  */
	 public int quantityDropped(Random par1Random)
	 {
		 if (dropOre == true)
		 {
			 return 1;
		 }
		 else
		 {
			 return 0;
		 }

	 }

	 /**
	  * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
	  */
	 /**public int quantityDroppedWithBonus(int par1, Random par2Random)
    {
        if (par1 > 0 && this.blockID != this.idDropped(0, par2Random, par1))
        {
            int var3 = par2Random.nextInt(par1 + 2) - 1;

            if (var3 < 0)
            {
                var3 = 0;
            }

            return this.quantityDropped(par2Random) * (var3 + 1);
        }
        else
        {
            return this.quantityDropped(par2Random);
        }
    } **/

}